<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@page import="com.followme.md5.impl.PersonDAOImpl"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <title>跳转的页面</title>
    <script type="text/javascript">
           function check(){
              var uidAry=document.getElementsByName("userId");
              var len=uidAry.length;
              var flag=false;
              
              for(var i=0;i<len;i++){
                 if(uidAry[i].checked){
                    flag=true;
                    break;
                 }
              }
              if(!flag){
                alert("请选择要删除的数据!!!");
              }else{
                //alert("OK");
                document.getElementById("myform").submit();
              }
           }
       </script>
  </head>
  
  <body>
    <form action="delete.jsp" id="myform">
    <center>
    <h1><font color="blue">用户信息</font></h1>
    <hr>
    <table border="1">
       <thead>
          <th>删除/批量</th>
          <th>用户ID</th>
          <th>用户密码</th>
       </thead>
       <tbody>
         <c:forEach items="${personList}" var="person">
         <tr>
           <td><input type="checkbox" value="${person.pid}" name="userId"/></td>
           <td>${person.pid}</td>
           <td>${person.pwd}</td>
           
         </tr>
         </c:forEach>
       
       </tbody>
       <tr>
           <td colspon="2"><input type="button" value="提交" onclick="check()"></td>
           <td><a href="login.jsp">返回</a></td>
       </tr>
       
    </table>
    </center>
    </form>
  </body>
</html>
